package edu.maping.easy.editor;

import processing.core.PApplet;
import edu.maping.easy.model.PolygonThing;
import edu.maping.easy.model.PolygonThingBezier;

public class PolygonFactory {

	public static final int NORMAL = 0;
	public static final int BEZIER = 1;

	private int polygonMode = NORMAL;

	private PApplet pApplet = null;

	public PolygonFactory(PApplet pApplet) {
		this.pApplet = pApplet;
	}

	public PolygonThing getNewPolygon() {
		switch (polygonMode) {
		case NORMAL:
			return new PolygonThing();
		case BEZIER:
			return new PolygonThingBezier(pApplet);
		default:
			break;
		}
		return null;
	}
	
	public void setMode(int mode){
		polygonMode = mode;
	}
}
